package com.leetcode.LC;

import java.util.HashMap;

public class LC1748 {
    public int sumOfUnique(int[] nums) {

        HashMap<Integer, Boolean> map = new HashMap<>();
        for (int num : nums) {
            if (map.containsKey(num)){
                map.put(num,false);
            }else {
                map.put(num,true);
            }
        }

        int sum=0;
        for (Integer integer : map.keySet()) {
            if (map.get(integer)){
                sum+=integer;
            }
        }
        return sum;
    }
}
